﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
   
    <ControlTemplate x:Key="ClearListButton" TargetType="{x:Type Button}" >
        <Image Source="../Themes/Button/ViderListe.png" Width="20" Height="17"/>
    </ControlTemplate>
    
    <ControlTemplate x:Key="LogoutButton" TargetType="{x:Type Button}" >
        <StackPanel Orientation="Horizontal">
            <Image Source="../Themes/Button/Logout.gif" Width="20" Height="17" Margin="0,0,5,0" VerticalAlignment="Center"/>
            <TextBlock Text="Se déconnecter" VerticalAlignment="Center"/>
        </StackPanel>
    </ControlTemplate>

    <ControlTemplate x:Key="SearchButton" TargetType="{x:Type Button}" >
        <Image Name="Image" Source="../Themes/Button/Loupe.png" Width="20" Height="17"/>
        <ControlTemplate.Triggers>
            <Trigger Property="IsEnabled" Value="false">
                <Setter Property="Visibility" Value="Collapsed" />
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    
    
    <Style TargetType="{x:Type Button}">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
        <Setter Property="MinHeight" Value="23"/>
        <Setter Property="MinWidth" Value="75"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Border x:Name="Border" CornerRadius="12,2,12,2" BorderThickness="1"
                        Background="{StaticResource NormalBrush}"
                        BorderBrush="{StaticResource NormalBorderBrush}">
                        <ContentPresenter Margin="5,0,5,0" HorizontalAlignment="Center" VerticalAlignment="Center" RecognizesAccessKey="True"/>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsKeyboardFocused" Value="true">
                            <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DefaultedBorderBrush}" />
                        </Trigger>
                        <Trigger Property="IsDefaulted" Value="true">
                            <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DefaultedBorderBrush}" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="Border" Property="Background" Value="{StaticResource DarkBrush}" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="Border" Property="Background" Value="{StaticResource PressedBrush}" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource PressedBorderBrush}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBorderBrush}" />
                            <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <Style x:Key="{x:Type GroupBox}" TargetType="{x:Type GroupBox}">
        <Setter Property="BorderBrush" Value="White"/>
    </Style>

    <!-- TextBox -->

    <Style x:Key="{x:Type TextBox}" TargetType="{x:Type TextBoxBase}">
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="True"/>
        <Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="MinWidth" Value="120"/>
        <Setter Property="MinHeight" Value="20"/>
        <Setter Property="AllowDrop" Value="true"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TextBoxBase}"><!--Background="LightGray"-->
                    <Border Name="Border" CornerRadius="0" Padding="2" Background="{StaticResource WindowBackgroundBrush}" 
                        BorderBrush="{StaticResource SolidBorderBrush}"
                        BorderThickness="1" >
                        <ScrollViewer Margin="0" x:Name="PART_ContentHost"/>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="Border" Property="Background" Value="LightGray"/>
                            <Setter TargetName="Border" Property="BorderBrush" Value="LightGray"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Validation.ErrorTemplate">
            <Setter.Value>
                <ControlTemplate>
                    <Border BorderBrush="Red" BorderThickness="1">
                        <AdornedElementPlaceholder />
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <!--checkbox-->
    <Style TargetType="{x:Type CheckBox}">
        <Setter Property="FontSize" Value="11" />
        <Setter Property="FontFamily" Value="Tahoma" />
        <Setter Property="Foreground" Value="#FF000000" />
        <Setter Property="Margin" Value="0,3,0,3" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type CheckBox}">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="16"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Grid HorizontalAlignment="Left" VerticalAlignment="Center" >
                            <Rectangle x:Name="Background" Height="14" Margin="1" Width="14" Stroke="White" StrokeThickness="1" RadiusX="2" RadiusY="2">
                            	<Rectangle.Fill>
                            		<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            			<GradientStop Color="White" Offset="1"/>
                            			<GradientStop Color="#FF2175B8"/>
                            		</LinearGradientBrush>
                            	</Rectangle.Fill>
                            </Rectangle>
                            <Path x:Name="CheckIcon" Opacity="0" Stretch="Fill" Stroke="#FFFFFFFF" Data="M32.192282,77.371554 L34.688632,80.304322 38.863374,72.720928" StrokeThickness="2" Width="12" Height="12" Margin="-1,-6.5,-5,0.5"/>
                            <Rectangle x:Name="IndeterminateIcon" Height="2" Width="6" Opacity="0" Fill="#FF333333"/>
                            <Rectangle x:Name="DisabledVisualElement" Height="14" Width="14" Opacity="0" Fill="#FFFFFFFF" RadiusX="1" RadiusY="1"/>
                            <Rectangle x:Name="ContentFocusVisualElement" Height="16" Width="16" IsHitTestVisible="false" Opacity="0" Stroke="#006DBDD1" StrokeThickness="1" RadiusX="2" RadiusY="2"/>
                        </Grid>
                        <ContentPresenter
								        Grid.Column="1"
								        x:Name="contentPresenter"
								        Content="{TemplateBinding Content}"
								        ContentTemplate="{TemplateBinding ContentTemplate}"
								        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
								        VerticalAlignment="Center"
								        Margin="3,0,0,0"/>
                    </Grid>

                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Stroke" TargetName="CheckIcon" Value="#FF2175B8" />
                            <Setter Property="Stroke" TargetName="Background" Value="#FFFFFFFF" />
                        </Trigger>
                        <Trigger Property="IsChecked" Value="True">
                            <Setter Property="Opacity" TargetName="CheckIcon" Value="1" />
                            <Setter Property="Stroke" TargetName="Background" Value="#FF2175B8" /> <!--Transparent-->
                        </Trigger>
                        <Trigger Property="IsFocused" Value="True">
                            <Setter Property="Opacity" TargetName="ContentFocusVisualElement" Value="1" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Opacity" TargetName="DisabledVisualElement" Value="0.55" />
                            <Setter Property="Opacity" TargetName="contentPresenter" Value="0.55" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter Property="Stroke" TargetName="CheckIcon" Value="#FF2175B8" />
                        </Trigger>
                    </ControlTemplate.Triggers>

                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    
    <Style x:Key="ScrollBarLineButton" TargetType="{x:Type RepeatButton}">
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="Focusable" Value="false"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Border 
          x:Name="Border"
          Margin="1" 
          CornerRadius="2" 
          Background="{x:Null}"
          BorderBrush="{x:Null}"
          BorderThickness="1">
                        <Path 
            HorizontalAlignment="Center"
            VerticalAlignment="Center"
            Fill="#404040"
            Data="{Binding Path=Content, RelativeSource={RelativeSource TemplatedParent}}" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="Border" Property="Background" Value="#E0E0E0" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="#888888"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ScrollBarPageButton" TargetType="{x:Type RepeatButton}">
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="IsTabStop" Value="false"/>
        <Setter Property="Focusable" Value="false"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Border Background="Transparent" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style x:Key="ScrollBarThumb" TargetType="{x:Type Thumb}">
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="IsTabStop" Value="false"/>
        <Setter Property="Focusable" Value="false"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Border 
          CornerRadius="2"
          BorderThickness="1" Background="#FF121212" BorderBrush="#FFCECECE" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <ControlTemplate x:Key="VerticalScrollBar" TargetType="{x:Type ScrollBar}">
        <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0" Width="Auto" >
            <Grid.RowDefinitions>
                <RowDefinition MaxHeight="18" Height="0.409*"/>
                <RowDefinition Height="0.182*"/>
                <RowDefinition MaxHeight="18" Height="0.409*"/>
            </Grid.RowDefinitions>
            <Border
      Grid.RowSpan="3"
      CornerRadius="2" 
      Background="#FF3B3B3B" Margin="15,22,15,22" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
            <RepeatButton 
      Grid.Row="0"                           
      Style="{StaticResource ScrollBarLineButton}"
      Height="18"
      Command="ScrollBar.LineUpCommand"
      Content="M 0 4 L 8 4 L 4 0 Z" Margin="10,0,10,0" />
            <Track 
      x:Name="PART_Track"
      Grid.Row="1"
      IsDirectionReversed="true">
                <Track.DecreaseRepeatButton>
                    <RepeatButton 
          Style="{StaticResource ScrollBarPageButton}"
          Command="ScrollBar.PageUpCommand" />
                </Track.DecreaseRepeatButton>
                <Track.Thumb>
                    <Thumb 
          Style="{StaticResource ScrollBarThumb}" 
          Margin="10,0,10,0"  
          Background="#C0C0C0"
          BorderBrush="#404040" Height="Auto" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="8" />
                </Track.Thumb>
                <Track.IncreaseRepeatButton>
                    <RepeatButton 
          Style="{StaticResource ScrollBarPageButton}"
          Command="ScrollBar.PageDownCommand" />
                </Track.IncreaseRepeatButton>
            </Track>
            <RepeatButton 
      Grid.Row="3" 
      Style="{StaticResource ScrollBarLineButton}"
      Height="18"
      Command="ScrollBar.LineDownCommand"
      Content="M 0 0 L 4 4 L 8 0 Z" Margin="10,0,10,0"/>
        </Grid>
    </ControlTemplate>
    
    <ControlTemplate x:Key="HorizontalScrollBar" TargetType="{x:Type ScrollBar}">
        <Grid >
            <Grid.ColumnDefinitions>
                <ColumnDefinition MaxWidth="18"/>
                <ColumnDefinition Width="0.00001*"/>
                <ColumnDefinition MaxWidth="18"/>
            </Grid.ColumnDefinitions>
            <Border
      Grid.ColumnSpan="3"
      CornerRadius="2" 
      Background="#FF3B3B3B" Margin="22,15,22,15" />
            <RepeatButton 
      Grid.Column="0"                           
      Style="{StaticResource ScrollBarLineButton}"
      Width="18"
      Command="ScrollBar.LineLeftCommand"
      Content="M 4 0 L 4 8 L 0 4 Z" Margin="0,10,0,10" />
            <Track 
      x:Name="PART_Track"
      Grid.Column="1"
      IsDirectionReversed="False">
                <Track.DecreaseRepeatButton>
                    <RepeatButton 
          Style="{StaticResource ScrollBarPageButton}"
          Command="ScrollBar.PageLeftCommand" />
                </Track.DecreaseRepeatButton>
                <Track.Thumb>
                    <Thumb 
          Style="{StaticResource ScrollBarThumb}" 
          Margin="0,10,0,10"  
          Background="#C0C0C0"
          BorderBrush="#404040" Height="8" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
                </Track.Thumb>
                <Track.IncreaseRepeatButton>
                    <RepeatButton 
          Style="{StaticResource ScrollBarPageButton}"
          Command="ScrollBar.PageRightCommand" />
                </Track.IncreaseRepeatButton>
            </Track>
            <RepeatButton 
      Grid.Column="3" 
      Style="{StaticResource ScrollBarLineButton}"
      Width="18"
      Command="ScrollBar.LineRightCommand"
      Content="M 0 0 L 4 4 L 0 8 Z" Margin="0,10,0,10"/>
        </Grid>
    </ControlTemplate>
    
    <Style x:Key="ComboBoxScrollBarStyle" TargetType="{x:Type ScrollBar}">
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Style.Triggers>
            <Trigger Property="Orientation" Value="Horizontal">
                <Setter Property="Width" Value="Auto"/>
                <Setter Property="Height" Value="Auto" />
                <Setter Property="Template" Value="{StaticResource HorizontalScrollBar}" />
            </Trigger>
            <Trigger Property="Orientation" Value="Vertical">
                <Setter Property="Width" Value="Auto"/>
                <Setter Property="Height" Value="Auto" />
                <Setter Property="Template" Value="{StaticResource VerticalScrollBar}" />
            </Trigger>
        </Style.Triggers>
    </Style>

 
</ResourceDictionary>